import { type CsvMapperRepresentation, CsvMapperRepresentationType } from '../../../../src/modules/internal/csvMapper/csvMapper-types';
import { ENTITY_TYPE_MALWARE } from '../../../../src/schema/stixDomainObject';

export const repMalware: CsvMapperRepresentation = {
  id: 'representation-malware',
  type: CsvMapperRepresentationType.Entity,
  target: {
    entity_type: ENTITY_TYPE_MALWARE,
  },
  attributes: [
    {
      key: 'name',
      column: {
        column_name: 'G',
      },
    },
    {
      key: 'is_family',
      column: {
        column_name: 'H',
      },
    },
    {
      key: 'malware_types',
      column: {
        column_name: 'I',
      },
    },
    {
      key: 'architecture_execution_envs',
      column: {
        column_name: 'J',
      },
    },
    {
      key: 'killChainPhases',
      based_on: {
        representations: ['representation-killchainphase']
      }
    }
  ]
};

export const repMalwareWithDefault: (kcf: string[]) => CsvMapperRepresentation = (kcf) => ({
  id: 'representation-malware-default',
  type: CsvMapperRepresentationType.Entity,
  target: {
    entity_type: ENTITY_TYPE_MALWARE,
  },
  attributes: [
    {
      key: 'name',
      column: {
        column_name: 'G',
      },
    },
    {
      key: 'is_family',
      default_values: ['true'],
      column: {
        column_name: 'H',
      },
    },
    {
      key: 'malware_types',
      default_values: ['ddosssss'],
      column: {
        column_name: 'I',
      },
    },
    {
      key: 'architecture_execution_envs',
      default_values: ['armmmm'],
      column: {
        column_name: 'J',
      },
    },
    {
      key: 'killChainPhases',
      default_values: kcf,
      based_on: {
        representations: ['representation-killchainphase']
      }
    }
  ]
});
